/*! _popovers.scss | Vuero | Css ninja 2020-2021 */

/*
    1. Web UI Popover
    2. Web UI Popover Dark mode
    3. User profile popovers
    4. User profile popovers Dark mode
    5. Simple popover
*/

/* ==========================================================================
1. Web UI Popover
========================================================================== */

.tippy-box[data-theme~='light'] {
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--light-box-shadow);

  .tippy-content {
    //padding: 0 !important;
    //border: none
  }
}

.v-popover {
  box-shadow: rgba(0, 0, 0, 0.04) 0 3px 10px 4px !important;
  background: var(--white) !important;
  color: var(--dark-text) !important;
  margin-top: -20px !important;
  border: 1px solid var(--fade-grey);

  &.top > .webui-arrow {
    border-top-color: var(--white) !important;
  }

  &.bottom-right > .webui-arrow {
    border-right-color: transparent !important;
    border-bottom-color: transparent !important;
  }

  &.top-right > .webui-arrow {
    border-right-color: transparent !important;

    &::after {
      border-top-color: var(--white) !important;
    }
  }

  &.top-left > .webui-arrow {
    border-top-color: var(--white) !important;
  }

  &.left > .webui-arrow {
    border-left-color: transparent !important;
  }

  .webui-arrow {
    border-top-color: transparent !important;
    border-right-color: transparent !important;

    &::after {
      border-top-color: transparent !important;
    }
  }

  .v-popover-title {
    background-color: var(--white) !important;
    border-bottom: none !important;
    font-weight: 500;
  }
}

.v-popover-content {
  font-size: 0.75rem !important;

  &.is-text {
    max-width: 200px;
    padding: 8px 5px 4px 5px;
    font-size: 0.9rem !important;
  }

  .popover-head {
    display: flex;
    align-items: center;
    margin-bottom: 10px;

    .v-avatar,
    .v-icon {
      margin-right: 10px;
    }

    h4 {
      font-family: var(--font-alt);
      font-weight: 600;
      font-size: 0.9rem;
      color: var(--dark);
      margin-bottom: 0;
    }
  }

  .popover-body {
    padding: 0;

    p {
      font-family: var(--font);
      font-size: 0.9rem;
      color: var(--light-text);

      &:last-child {
        margin-bottom: 8px;
      }
    }
  }

  .popover-flex-block {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 5px 0;

    .staff-avatar {
      height: 38px;
      width: 38px;
      border-radius: var(--radius-rounded);
    }

    .content-block {
      margin-left: 10px;

      label,
      span {
        display: block;
      }

      label {
        color: var(--dark-text-light-35);
        text-transform: uppercase;
        font-size: 70%;
      }
    }

    .fa.fa-star,
    .fa.fa-star-half {
      color: #ffd700;
    }

    .icon-block {
      height: 38px;
      width: 38px;
      display: flex;
      justify-content: center;
      align-items: center;

      svg {
        height: 18px;
        width: 18px;
        color: var(--dark-text);
        stroke-width: 1.3px;

        &.is-medium {
          height: 26px;
          width: 26px;
        }
      }
    }
  }
}

/* ==========================================================================
2. Web UI Popover Dark mode
========================================================================== */

.is-dark {
  .v-popover {
    background: var(--dark-sidebar) !important;
    border-color: var(--dark-sidebar-light-6);

    &.top {
      .webui-arrow {
        border-top-color: var(--dark-sidebar) !important;
      }
    }

    &.right {
      .webui-arrow {
        border-top-color: transparent !important;
        border-right-color: var(--dark-sidebar) !important;

        &::after {
          border-right-color: var(--dark-sidebar) !important;
        }
      }
    }

    &.left {
      .webui-arrow {
        &::after {
          border-left-color: var(--dark-sidebar) !important;
        }
      }
    }

    &.bottom {
      .webui-arrow {
        &::after {
          border-bottom-color: var(--dark-sidebar) !important;
        }
      }
    }

    &.bottom-right,
    &.bottom-left {
      .webui-arrow {
        &::after {
          border-bottom-color: var(--dark-sidebar) !important;
        }
      }
    }

    &.top-right {
      .webui-arrow {
        &::after {
          border-top-color: var(--dark-sidebar) !important;
        }
      }
    }

    &.top-left {
      .webui-arrow {
        border-top-color: var(--dark-sidebar) !important;
      }
    }

    .v-popover-inner {
      background: var(--dark-sidebar) !important;
      border-color: var(--dark-sidebar) !important;
    }

    .title {
      color: var(--primary-grey-dark-5) !important;
    }

    .country img,
    .primary-skill img {
      border-color: var(--dark-sidebar) !important;
    }

    .notification-content {
      a {
        color: var(--primary) !important;
      }

      span {
        color: var(--primary-grey-dark-10) !important;
      }
    }

    .media + .media {
      border-top-color: var(--dark-sidebar-light-10) !important;
    }

    .loader-overlay {
      background: rgba(42, 42, 44, 0.95) !important;
    }
  }
}

/* ==========================================================================
3. User profile popovers
========================================================================== */

.v-popover-profile {
  .profile-popover-block,
  .skill-popover-block {
    max-width: 260px;
    text-align: left;

    .profile-popover-wrapper,
    .skill-popover-wrapper {
      display: flex;
      justify-content: flex-start;
      align-items: stretch;
      padding: 11px 6px;

      .popover-avatar,
      .popover-fake-avatar {
        position: relative;
        width: 44px;
        height: 44px;
        min-width: 44px;
        z-index: 0;

        img {
          display: block;
        }

        .avatar {
          width: 44px;
          height: 44px;
          border-radius: var(--radius-rounded);
        }

        .badge {
          position: absolute;
          right: -2px;
          bottom: 0;
          width: 20px;
          height: 20px;
          border: 1.6px solid var(--white);
          border-radius: var(--radius-rounded);
        }
      }

      .popover-fake-avatar {
        background: var(--fade-grey-light-3);
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-rounded);

        &.is-primary {
          background: var(--primary-light-42);

          span {
            color: var(--primary);
          }
        }

        &.is-accent {
          background: var(--primary-light-36);

          span {
            color: var(--primary);
          }
        }

        &.is-success {
          background: var(--success-light-45);

          span {
            color: var(--success);
          }
        }

        &.is-info {
          background: var(--info-light-45);

          span {
            color: var(--info);
          }
        }

        &.is-warning {
          background: var(--warning-light-32);

          span {
            color: var(--warning);
          }
        }

        &.is-danger {
          background: var(--danger-light-36);

          span {
            color: var(--danger);
          }
        }

        &.is-h-purple {
          background: var(--purple-light-36);

          span {
            color: var(--purple);
          }
        }

        &.is-h-orange {
          background: var(--orange-light-18);

          span {
            color: var(--orange);
          }
        }

        &.is-h-blue {
          background: var(--blue-light-32);

          span {
            color: var(--blue);
          }
        }

        &.is-h-red {
          background: var(--red-light-38);

          span {
            color: var(--red);
          }
        }

        &.is-h-green {
          background: var(--green-light-22);

          span {
            color: var(--green);
          }
        }

        &.is-h-yellow {
          background: var(--yellow-light-22);

          span {
            color: var(--yellow-dark-8);
          }
        }

        span {
          font-size: 1.1rem;
          font-family: var(--font);
          text-transform: uppercase;
          font-weight: 500;
          color: var(--dark-text);
        }
      }

      .popover-meta {
        margin-left: 16px;

        span {
          display: block;

          &.user-meta,
          &.skill-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;

            .username,
            .skill-name {
              display: block;
              font-family: var(--font-alt);
              line-height: 1.2;
              font-size: 0.9rem;
              font-weight: 600;
            }

            .location {
              font-size: 0.75rem;
              color: var(--light-text);
            }
          }

          &.job-title,
          &.skill-type {
            font-size: 0.8rem;
            color: var(--primary);
            font-weight: 500;
          }

          &.bio,
          &.skill-description {
            font-size: 0.8rem;
            color: var(--light-text);
          }
        }
      }
    }

    .popover-actions {
      position: relative;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      padding: 8px 12px 12px 12px;

      .button {
        height: 26px;
      }

      .popover-icon {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 30px;
        height: 30px;
        max-width: 30px;
        margin: 0 2px;
        border-radius: var(--radius-rounded);
        transition: all 0.3s;
        cursor: pointer;
        pointer-events: all !important;

        &:hover {
          background: var(--fade-grey-light-3);

          svg {
            color: var(--light-text);
          }
        }

        svg {
          width: 16px;
          height: 16px;
          color: var(--light-text);
        }
      }
    }

    .loader-overlay {
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      right: 0;
      margin: 0 auto;
      display: flex;
      border-radius: 8px;
      justify-content: center;
      align-items: center;
      background: rgba(255, 255, 255, 0.95);
      opacity: 0;
      transition: all 0.3s;
      z-index: 0;
      pointer-events: none;

      &.is-active {
        opacity: 1;
        z-index: 1;
        pointer-events: all;
      }

      .loader {
        &.is-loading {
          height: 24px;
          width: 24px;
          min-height: 24px;
          min-width: 24px;
        }
      }
    }
  }
}

/* ==========================================================================
4. User profile popovers Dark mode
========================================================================== */

.is-dark {
  .tippy-box {
    background: var(--dark-sidebar) !important;
    border-color: var(--dark-sidebar-light-6);
  }

  .tippy-box[data-theme~='light'][data-placement^='top']
    > .tippy-arrow::before {
    border-top-color: var(--dark-sidebar) !important;
  }

  .tippy-box[data-theme~='light'][data-placement^='bottom']
    > .tippy-arrow::before {
    border-bottom-color: var(--dark-sidebar) !important;
  }

  .tippy-box[data-theme~='light'][data-placement^='left']
    > .tippy-arrow::before {
    border-left-color: var(--dark-sidebar) !important;
  }

  .tippy-box[data-theme~='light'][data-placement^='right']
    > .tippy-arrow::before {
    border-right-color: var(--dark-sidebar) !important;
  }

  .tippy-profile {
    background: var(--dark-sidebar) !important;
    border-color: var(--dark-sidebar-light-6);
  }

  .v-popover-profile {
    background: var(--dark-sidebar) !important;

    .profile-popover-block {
      .badge {
        border-color: var(--dark-sidebar) !important;
      }

      .user-meta,
      .skill-meta {
        .username,
        .skill-name {
          color: var(--primary-grey-dark-5);
        }
      }

      .job-title,
      .skill-type {
        color: var(--primary) !important;
      }

      .popover-actions .popover-icon:hover {
        background: var(--dark-sidebar-light-6) !important;

        svg {
          color: var(--primary);
        }
      }
    }
  }
}
